<template>
  <div>
    <CategorySelector :disabled="!isShowAttrList" />
    <!-- 
      isShowAttrList:false 列表不显示，添加属性组件显示 
      添加属性组件显示 ，此时需要按钮禁用， 三级分类输入框也禁用 -> disabled:true
     -->
    <AttrList
      v-if="isShowAttrList"
      @setIsShowAttrList="isShowAttrList = $event"
    />
    <AddOrUpdateAttr v-else @setIsShowAttrList="isShowAttrList = $event" />
  </div>
</template>

<script lang="ts">
export default {
  name: "XAttr",
};
</script>

<script lang="ts" setup>
import CategorySelector from "@/components/CategorySelector/index.vue";
import AttrList from "./components/AttrList.vue";
import AddOrUpdateAttr from "./components/AddOrUpdateAttr.vue";
import { ref } from "vue";
const isShowAttrList = ref(true);
</script>

<style scoped></style>
